import pytest

from package_unittest.login import login


# case1 : 输入正确的用户名和正确的密码进行登录
def test_login_success():
    print("1")
    expect_result = 0
    actual_result = login('admin','123456').get('code')
    assert expect_result == actual_result

# case2 : 输入正确的用户名和错误的密码进行登录
def test_password_is_wrong():
    print("2")
    expect_result = 3
    actual_result = login('admin', '1234567').get('code')
    assert expect_result == actual_result


# case3 : 输入用户名和空的密码进行登录
def test_password_is_null():
    print("3")
    expect_result = 2
    actual_result = login('admin', '').get('code')
    assert expect_result == actual_result


if __name__ == '__main__':
    pytest.main(['test02_login_function.py'])
